/**********************************************************************************
* CLASS
*		ButtomImage
*
* DESCRIPTION
*		Generate Button from the image that let user can create the button by the image.
*
* REVISION HISTORY
*		Revision 1.0 2008/10/26 Atthaboon S.
*		First Release
*
**********************************************************************************/
var ButtomImage = Class.create({

	/****************************************************
	* FUNCTION
	*		initialize
	*
	* DESCRIPTION
	* 		initialize the Image button object.
	*
	* ARGUMENTS
	*		image_normal	 :	src image normal
	*		image_mouseover   :	src image mouse over
	*		width			 : 	button width
	*		height		 :	button height
	*
	****************************************************/
	initialize: function(image_normal,image_mouseover,width,height)
  	{
		this.imageButton =  new Element('img', { 'src':image_normal});
		$(this).imageButton.setStyle({
			width:    parseInt(width) +'px',
			height:   parseInt(height) +'px'
		});
		
		this.imageButton.onmouseover = function(e) {
			this.src = image_mouseover;
			// For make ie 6 support png file
			if(BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6 && this.src.search('.png') != -1)
			{
				this.pngHack();
			}
		}
		
		this.imageButton.onmouseout = function(e) {
			this.src = image_normal;
			// For make ie 6 support png file
			if(BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6 && this.src.search('.png') != -1)
			{
				this.pngHack();
			}
		}
		
		// For make ie 6 support png file
		if(BrowserDetect.browser == "Explorer" && BrowserDetect.version == 6 && this.imageButton.src.search('.png') != -1)
		{
			 $(this.imageButton).pngHack();
		}
	},
		
	/****************************************************
	* FUNCTION 
	*		getDomObj
	*
	* DESCRIPTION
	* 		Use by Genesis for get Image button dom Object.
	*
	* ARGUMENTS
	*
	****************************************************/
	getDomObj : function()
	{
		return this.imageButton;
	}
});